<template>
  <div id="app">
    <TopNav v-show="$root.playingMusic.isRcmd"></TopNav>
    <!-- router-view 是路由匹配到视图组件显示位置 -->
    <div>
      <keep-alive>
        <router-view/>
      </keep-alive>
    </div>
    <div class="play" v-show="$root.playingMusic.isShow">
      <Player :musicID="$root.playingMusic.musicID"></Player>
    </div>
  </div>
</template>
<script>
//App.vue也是组件. 是根组件
import TopNav from "./components/TopNav";
import Player from './components/Player';
export default {
  components: {
    TopNav,
    Player
  },
  data(){
    return {
      
    }
  },
  methods:{
    playMusic(id){
        this.musicID=id;
    }
  }
};
</script>
<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
*{
  margin: 0;
  padding: 0;
}
/* kele88.cn */
.play{
  width: 100%;
  height: 50px;
  position: fixed;
  bottom: 0;
}
</style>
